package drrr.controller;

import drrr.orm.RoomEntity;
import org.apache.struts2.ServletActionContext;

import java.util.List;
import java.util.Map;

/**
 * 获取聊天室聊天记录
 * Created by Xun on 2015/4/28.
 */
public class RoomChatList extends BaseAction {
    private List roomChatlists;


    public List getRoomChatlists() {
        return roomChatlists;
    }

    public void setRoomChatlists(List roomChatlists) {
        this.roomChatlists = roomChatlists;
    }

    @Override
    public String execute() throws Exception {
        Map<String, Object> session = ServletActionContext.getContext().getSession();
        int roomId = ((RoomEntity) session.get("room")).getId();
        this.setRoomChatlists(this.getAllService().getRoomChatListService().getEntitiesbyID(roomId));
        return SUCCESS;
    }
}
